/*************************************************************************
*    AUTHOR : Adeem Salik
*    Student Id : mc110202704
*    Date Created : 14 May, 2013
***************************************************************************/
#include <iostream.h>

using namespace std;
        char sVUId[] = "MC110202704";
        char sVUIdMat[8][9];
        char *start;
        char *end;
        
        void DisplayVUID()
        {
             cout << "My VUID is: " << sVUId << endl;
        }
        void DisplayReverse(char *revId)
        {
             int slen = strlen(sVUId);
             cout << "My VUID in reverse order: ";
             for (int i=slen;i>=0;--i)
             {
                 cout << revId[i-1];
             }
             cout << endl;
        }
        void StoreDiagonal()
        {
             for (int i=0;i<9;i++)
             {
                 for (int j=0;j<10;j++)
                 {
                     if (i==j)
                        sVUIdMat[i][j] = sVUId[j+2];
                     else
                        sVUIdMat[i][j] = '0';
                 }
                 sVUIdMat[i][9] = '\0';
             }
             cout << "Digits of my VUID are stored in the diagonal of the Matrix" << endl;
             //cout << sVUIdMat[0] << endl << endl;
             for (int i=0;i<9;i++)
             {
                 for (int j=0;j<9;j++)
                 {
                     cout << sVUIdMat[i][j] << " ";
                 }
                 cout << endl;
             }
        }
main()
{
    DisplayVUID();
    DisplayReverse(sVUId);
    StoreDiagonal();
      
    system("pause");

}
